package main;

import java.io.File;
import javax.swing.filechooser.*;

/**
 * Filters out all files types excepts txt files
 * and directories in the JFileChooser dialog.
 * @author yepc
 *
 */
public class ProjectFileFilter extends FileFilter {

	/**
	 * Accept all directories and txt files.
	 */
    public boolean accept(File f) {
        if (f.isDirectory()) {
            return true;
        }

        if(f.getName().toLowerCase().endsWith(".txt"))
        	return true;

        return false;
    }

    /**
     * The description of this filter.
     */
    public String getDescription() {
        return "Just txt Files";
    }
}